package com.example.handlerdemo;

import android.os.Handler;
import android.os.Message;
import android.util.Log;

/**
 * Created by tangjiangxu on 9/25/17.
 */

public class MyHandler extends Handler {
    private static final String TAG = "MyHandler";
    private MyEventListener mListener;

    public MyHandler(MyEventListener listener) {
        mListener = listener;
    }

    @Override
    public void handleMessage(Message msg) {
        if (mListener != null) {
            mListener.handleMessage(msg);
        }
        super.handleMessage(msg);
    }
}
